//
//  BusinessInfoCollectCell.m
//  BaseProject
//
//  Created by 王洋 on 2020/10/21.
//  Copyright © 2020 王洋. All rights reserved.
//

#import "BusinessInfoCollectCell.h"

@implementation BusinessInfoCollectCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        
        [self.maskBGView pp_clipCorners:UIRectCornerAllCorners radius:self.maskBGView.frame.size.height/2];
        
    });
}

- (void)fillCellWithModel:(BusinessInfoCollectModel *)model {
    
    [self.mainImageView sd_setImageWithURL:[NSURL URLWithString:model.img] placeholderImage:[UIImage imageNamed:model.localImg]];
    
    self.mainTitleLab.text = model.title;
    
    if (model.isSel) {
        self.selImageView.hidden = NO;
        self.maskBGView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:1];
//        [self.maskView pp_clipCorners:UIRectCornerAllCorners radius:self.frame.size.height/2];


    } else {
        self.selImageView.hidden = YES;
        self.maskBGView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.4];
//        [self.maskView pp_clipCorners:UIRectCornerAllCorners radius:self.frame.size.height/2];


    }
    
}

@end
